/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package rmiinterface;

import com.thoughtworks.xstream.XStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author chris
 */
public class Person {

    private String name;
    private String password;
    private boolean rightsEncr;
    private boolean rightsDecr;

    // constructor for general purpose
    public Person(String name, String password, boolean rightsEncr, boolean rightsDecr) {
        setName(name);
        setPassword(password);
        setRightsEncr(rightsEncr);
        setRightsDecr(rightsDecr);
    }

    // toString() method
    @Override
    public String toString() {
        return String.format("Name: %s\nPassword: %s\nRights for encryption: %b\nRights for decryption: %b\n", getName(), getPassword(),
                getRightsEncr(), getRightsDecr());
    }

    // get for name
    public String getName() {
        return name;
    }

    //set for name
    public void setName(String name) {
        if (name != null) {
            this.name = name;
        }
    }

    // get for password
    public String getPassword() {
        return password;
    }

    // set for password
    public void setPassword(String password) {
        if (password != null) {
            this.password = password;
        }
    }

    // get for rights for encryption
    public boolean getRightsEncr() {
        return rightsEncr;
    }

    // set for rights for encryption
    public void setRightsEncr(boolean rightsEncr) {
        this.rightsEncr = rightsEncr;
    }

    // get for rights for decryption
    public boolean getRightsDecr() {
        return rightsDecr;
    }

    // set for rights for decryption
    public void setRightsDecr(boolean rightsDecr) {
        this.rightsDecr = rightsDecr;
    }

    

}
